Skip to main content

Accessing data from containers and creating new containers

A container site refers to a site that a container is at. With this site, the current status of the container at that site such as weight can be queried.

While containers at a container site may be replaced, emptied, filled up, etc., the container site will remain the same

For more information on the relationship between a container site and a BinBar visit Associating a BinBar with a Container Site

For information on what can be queried refer to the container site documentation

How to create a new container site

1. Find the ID of the service location in which the container site will belong. For more information on how to query service locations, visit Accessing data from service locations and creating new service locatiions

2. Create a new container site using the mutation createContainerSite

Create a new container site
mutation CreateContainerSite($input: CreateContainerSiteInput!) {
createContainerSite(input: $input) {
__typename
name
id
# Some 'containerSite' fields omitted for brevity
}
}

variables = {
input: {
name: 'My New Container Site',
serviceLocationID: serviceLocationID,
maxWeight: { value: 12.5, unit: 'KILOGRAM' },
size: 24
}
}
tip

When creating new service locations, container sites, and BinBars, it may be useful to query for that ID at the same time so you do not have to query for it later if you are doing a operation with it immediatley after


How to find all container sites

Using the query currentUser

Find all container sites
query currentUser {
currentUser {
account {
containerSites {
__typename
name
id
# Some 'containerSite' fields omitted for brevity
}
}
}
}
caution

Larger queries will take longer to retrieve. For larger queries, we recommend using the optional paginationInput. To learn more, visit Paginating Queries


How to find a container sites's information with an ID

Using the query containerSiteByID

Find a container site by ID
query ContainerSiteByID($id: ID!) {
containerSiteByID(id: $id) {
__typename
id
name
# Some 'containerSite' fields omitted for brevity
}
}

variables = { id: '23498cadfe3234cf232342cdsg' };